package com.handinglian.ai.notice.enums;

public enum ImportStateEnum {
    IMPORT(1,"已导入"),
    NOT_IMPORT(0,"未导入");

    public static ImportStateEnum valueOfOrdinal(Integer ordinal) {
        return ordinal == null || ordinal >= values().length ? null : values()[ordinal];
    }
    public static ImportStateEnum valueOfDesc(String desc) {
        for(ImportStateEnum importStateEnum : ImportStateEnum.values()){
            if(desc.equals(importStateEnum.getDescription())){
                return importStateEnum;
            }
        }
        return null;
    }
    public static ImportStateEnum valueOfKey(Integer key){
        for(ImportStateEnum importStateEnum : ImportStateEnum.values()){
            if(importStateEnum.getKey()==key){
                return importStateEnum;
            }
        }
        return null;
    }
    private final Integer key;
    private final String description;

    ImportStateEnum(Integer key, String description) {
        this.key = key;
        this.description = description;
    }

    public Integer getKey() {
        return key;
    }
    public String getDescription() {
        return this.description;
    }
}
